// components/the-refresh/index.js
import { virtualHostConfig } from '@/behavior/virtualHost'
import { commonBehavior } from '@/behavior/common'

Component({
  ...virtualHostConfig({
    behaviors: [commonBehavior]
  }),

  /**
   * 组件的属性列表
   */
  properties: {
    enable: Boolean,
    loadingProps: {
      type: Object,
      value: { size: '36rpx', }
    },
    lowerThreshold: {
      type: Number,
      optionalTypes: [String],
      value: 50
    },
    upperThreshold: {
      type: Number,
      optionalTypes: [String],
      value: 50
    },
    scrollIntoView: String,
    showTop: Boolean,
    topBtn: Object
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    scrollToTop () {
      this.selectComponent('.the-pull-down-refresh').scrollToTop()
    }
  }
})
